{include file="common/top" /}
<link  type="text/css" href="__static/ossupload/style.css"/>
<style>
html{
	background: #ffffff;
}
</style>

<form class="layui-form " action="" style="background: #fff;">
	<table class="layui-table">
	  <tbody>
	    <tr>
	      <td style="width:14%">客户名称：</td>
	      <td style="width:28%">{$rs.customer_name}</td>
	      <td style="width:15%">打款金额：</td>
	      <td >{$rs.amount}</td>
	    </tr>
	    <tr>
	      <td>公司卡号：</td>
	      <td>{$rs.num}</td>
	      <td>开户行地址：</td>
	      <td>{$rs.bank_address}</td>
	    </tr>
	    <tr>
	      <td>银行卡户主：</td>
	      <td>{$rs.account_name}</td>
	      <td>银行卡类型：</td>
	      <td>{:$rs['type']==1?'对公':'对私'}</td>
	    </tr>
	    <tr>
	      <td>备注：</td>
	      <td colspan=3>{$rs.note}</td>
	      
	    </tr>
	  </tbody>
	</table>
	<hr/>
	<div class="layui-form-item">
		<label class="layui-form-label">上传凭证：</label>
		<div class="layui-col-xs4">
			<div class="layui-upload-drag" id="test10">
				  <i class="layui-icon"></i>
				  <p>点击上传，或将文件拖拽到此处</p>
				  <div class="layui-hide" id="uploadDemoView">
					  <hr>
					<img src="" alt="上传成功后渲染" style="max-width: 196px">
				  </div>
			</div>
		</div>
	</div>
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden"  name="id" value="{$Request.get.id}">
			<input type="hidden" id='image'  name="finance_url" value="">
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">提交</button>
		</div>
	</div>
	
</form>
{include file="common/footer" /}
<script>
	layui.use(['form', 'layedit', 'laydate','upload'], function(){
		  var form = layui.form ,layer = layui.layer,upload = layui.upload,$ = layui.jquery;
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('return_money_cashier')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_load(data['msg']);
				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			return false;
		  });
		//拖拽上传
		upload.render({
		    elem: '#test10'
		    ,url: '{:url("Upload/index")}' //改成您自己的上传接口
		    ,exts: 'jpg|png|jpeg|gif'
	    	,choose: function(obj){
	    		layer.load(1, { shade : [ 0.5, '#676a6c' ] });
	    	}
		    ,done: function(res){
		    	layer.closeAll();
		    	if(res.code == 0){
		    		layer.msg('上传成功');
				    layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.data);
				    $("input[name=finance_url]").val(res.data);
		    	}else{
		    		layer.msg(res.msg);
		    	}
		      
		      //console.log(res)
		    }
		  });
	});
	
	
</script>
